URL = "http://libsquish.googlecode.com/files/squish-%(VERSION)s.tar.gz"
VERSIONS = ["1.10"]
DEFAULT_VERSION = "1.10"
from source.builders import VisualStudioBuilder
import os

class SquishWindowsVS2008Builder( VisualStudioBuilder ):
    
  def make(self ):
  
    os.chdir( self.extractedpath + os.sep + "vs7" )
    
    if self.machine.isVS2008():
      self.execute( "devenv /Upgrade squish.sln" )
  
    if self.machine.bits == 64:
      self.convertProjTo64("squish\\squish.vcproj")
      self.convertSolutionTo64("squish.sln")
    self.execute( "devenv squish\\squish.vcproj /Build \"Debug\" " )
    self.execute( "devenv squish\\squish.vcproj /Build \"Release\" " )

  def install(self):
    os.chdir(self.extractedpath)
    libdir = self.installpath() + "/lib"
    includedir = self.installpath() + "/include/squish"

    #dynamic link libs
    self.copyfile( "lib/squishd.lib", libdir )
    self.copyfile( "lib/squish.lib", libdir )
    #headers
    self.copypattern(".", "^.*\\.h$", includedir )

BUILDER = SquishWindowsVS2008Builder    
